<html>
    <!--
      Mix unit value: Motion

      This benchmark mixes simple unit values.
    -->
    <head>
        <style>
            body {
                padding: 0;
                margin: 0;
            }

            .container {
                padding: 100px;
                width: 100%;
                display: flex;
                flex-wrap: wrap;
            }

            .container > div {
                width: 100px;
                height: 100px;
            }

            .box {
                width: 10px;
                height: 100px;
                background-color: #fff;
            }
        </style>
    </head>
    <body>
        <div class="container"></div>
        <script type="module" src="/src/imports/gsap.js"></script>
        <script type="module">
            /**
             * Create an interpolate function that mixes unit values.
             */
            const px = gsap.utils.interpolate(
                [100, 100, 100, 100],
                [0, 0, 0, 0]
            )

            const numRuns = 1000000
            let startTime = performance.now()
            for (let i = 0; i < numRuns; i++) {
                px(i / numRuns)
            }
            console.log(`First run: ${performance.now() - startTime}ms`)
        </script>
    </body>
</html>
